﻿using System;
using SecurityTokenServiceNS;
using System.IdentityModel.Policy;
using System.IdentityModel.Claims;
using System.Collections.ObjectModel;
using System.Collections.Generic;

namespace IssuedClaimsAddIns
{
	class IssuedClaimsModuleAPolicies : IIssuedClaimsProcessor
	{
		public void GetIssuedClaims(RST rst, Collection<Claim> claims)
		{
			AuthorizationContext context =
				AuthorizationContext.CreateDefaultAuthorizationContext(AddInTool.GetAuthorizationPolicies());
			foreach (ClaimSet claimset in context.ClaimSets)
				foreach (Claim claim in claimset)
					claims.Add(claim);
		}
	}
}
